<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>margin间的重叠</title>
        <style>
            .s1{
                width: 300px;
                height: 300px;
                margin: 50px;
                background: #4d8000;
            }
            div{
                overflow: hidden;
            }
        </style>
    </head>
    <body>
        <!--利用BFC避免margin重叠。-->
        <div class="s1"></div>
        <div><div class="s1"> </div></div>
    </body>
</html>